/**
 * @project readnote
 * @Title BookService.java
 * @author huxh
 * @date 2012-2-12
 **/
package com.readnote.book.service;

import java.util.List;

import com.cr.backbone.hibenate.AppBaseService;
import com.readnote.book.model.Book;
import com.readnote.book.model.UserBook;
import com.readnote.user.model.User;

public interface UserBookService extends AppBaseService<UserBook> {
	
	/**
	 * 用户添加书籍到我的书籍
	 * @param book
	 * @param user
	 */
	public void saveAddUserBook(Book book,User user);
	
	
	/**
	 * 用户是否已经存在此书籍
	 * @param book
	 * @param user
	 * @return
	 */
	public boolean haveUserBook(Book book,User user);
	
	/**
	 * 获取单个用户书籍对象,by用户、书籍
	 * @param book
	 * @param user
	 * @return
	 */
	public UserBook getUserBookByBookAndUser(Book book,User user);
	
	/**
	 * 获取用户书籍集合，by用户
	 * @param user
	 * @return
	 */
	public List<UserBook> getListUserBookByUser(User user) ;
	
}
